Re: Error while trying to allocate memory (malloc)

2012-08-07 Thread Marco Leise
Am Mon, 6 Aug 2012 18:25:01 +0200 schrieb Andrej Mitrovic andrej.mitrov...@gmail.com: On 8/6/12, CrudOMatic crudoma...@gmail.com wrote: another quick question - are these allocations automatically entered into the GC heap? If so then I can just disable garbage collection? No, there is

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread Minas Mina
Maybe you need a cast before malloc to convert it to a s_blockInfo*?

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread CrudOMatic
On Monday, 6 August 2012 at 13:22:08 UTC, Minas Mina wrote: Maybe you need a cast before malloc to convert it to a s_blockInfo*? Just did, and compiled. Errored out with (from my IDE): (9:54:32 AM) AccessViolation-Exception (9:54:32 AM) c005 (9:54:32 AM) Exception in debugger client

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread Eyyub
On Monday, 6 August 2012 at 13:59:35 UTC, CrudOMatic wrote: On Monday, 6 August 2012 at 13:22:08 UTC, Minas Mina wrote: Maybe you need a cast before malloc to convert it to a s_blockInfo*? Just did, and compiled. Errored out with (from my IDE): (9:54:32 AM) AccessViolation-Exception (9:54:32

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread CrudOMatic
On Monday, 6 August 2012 at 14:14:12 UTC, Eyyub wrote: On Monday, 6 August 2012 at 13:59:35 UTC, CrudOMatic wrote: On Monday, 6 August 2012 at 13:22:08 UTC, Minas Mina wrote: Maybe you need a cast before malloc to convert it to a s_blockInfo*? Just did, and compiled. Errored out with (from

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread Eyyub
On Monday, 6 August 2012 at 14:55:05 UTC, CrudOMatic wrote: In C it was just declare and go... Really ? I don't think, because : s_blockHeader* m_blockList; Here, m_blockList is a pointer to s_blockHeader struct, and so the default value is `null`. So, trying to access to(?) a struct member

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread Andrej Mitrovic
On 8/6/12, Eyyub eyyub.pangeara...@gmail.com wrote: Tell me if I'm wrong. (I did not programming in C since 2 years) You're not wrong. m_blockList is a pointer and OP needs to allocate an s_blockHeader instance before he uses it: s_blockHeader* m_blockList =

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread CrudOMatic
On Monday, 6 August 2012 at 15:36:03 UTC, Andrej Mitrovic wrote: On 8/6/12, Eyyub eyyub.pangeara...@gmail.com wrote: Tell me if I'm wrong. (I did not programming in C since 2 years) You're not wrong. m_blockList is a pointer and OP needs to allocate an s_blockHeader instance before he uses

Re: Error while trying to allocate memory (malloc)

2012-08-06 Thread CrudOMatic
On Monday, 6 August 2012 at 15:36:03 UTC, Andrej Mitrovic wrote: On 8/6/12, Eyyub eyyub.pangeara...@gmail.com wrote: Tell me if I'm wrong. (I did not programming in C since 2 years) You're not wrong. m_blockList is a pointer and OP needs to allocate an s_blockHeader instance before he uses