1. not used warning from std/memory.e

I am perplexed by a 'not used' warning concerning the constant M_FREE in std/memory.e. M_FREE is declared and set on line 17 and is used on line 300. Why should I see this error?

Shawn Pringle

new topic     » topic index » view message » categorize

2. Re: not used warning from std/memory.e

SDPringle said...

I am perplexed by a 'not used' warning concerning the constant M_FREE in std/memory.e. M_FREE is declared and set on line 17 and is used on line 300. Why should I see this error?

Shawn Pringle

For me the corresponding lines are 42 and 271 ...

new topic     » goto parent     » topic index » view message » categorize

3. Re: not used warning from std/memory.esv

jimcbrown said...
SDPringle said...

I am perplexed by a 'not used' warning concerning the constant M_FREE in std/memory.e. M_FREE is declared and set on line 17 and is used on line 300. Why should I see this error?

Shawn Pringle

For me the corresponding lines are 42 and 271 ...

What version do you guys have? I'm at r2210, and I get:

$ grep -n M_FREE memory.e 
45:        M_FREE = 17 
306:            machine_proc(M_FREE, addr) 

But, it's important to note how M_FREE is used:

	ifdef not DATA_EXECUTE then 
        	machine_proc(M_FREE, addr) 
	elsedef 

So my guess is that Shawn is running code where DATA_EXECUTE is not defined. I have no idea what that is all about, but here, on Linux, I don't get a warning, so I assume that DATA_EXECUTE is not defined. I assume this has something to do with DEP and other memory protection stuff.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: not used warning from std/memory.e

SDPringle said...

I am perplexed by a 'not used' warning concerning the constant M_FREE in std/memory.e. M_FREE is declared and set on line 17 and is used on line 300. Why should I see this error?

Shawn Pringle

Because its only used if DATA_EXECUTE is defined. However, which is the correct name "DATA_EXECUTE" or "EXECUTE_DATA" because you use both in the code.

The correct usage needs to be ...

constant M_ALLOC = 16 
ifdef EXECUTE_DATA then 
    constant M_FREE = 17 
end ifdef 
new topic     » goto parent     » topic index » view message » categorize

5. Re: not used warning from std/memory.e

Yes. Thank you. I have decided on DATA_EXECUTE because that is in the DEP acronym. It all makes sense now.

Shawn

new topic     » goto parent     » topic index » view message » categorize

6. Re: not used warning from std/memory.e

Please don't fix std/memory.e. I have this file open and if you do I'll get conflicted files on commit.

Shawn

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu