Author |
Topic: :o Google Question (Read 1080 times) |
|
saiyadshakil
Newbie


Posts: 4
|
 |
:o Google Question
« on: Oct 4th, 2007, 1:14am » |
Quote Modify
|
How would you implement malloc in C and garbage collection in C++?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
    
 Some people are average, some are just mean.
Gender: 
Posts: 13730
|
 |
Re: :o Google Question
« Reply #1 on: Oct 4th, 2007, 1:22am » |
Quote Modify
|
Isn't malloc already implemented in C, why would it need to be reimplemented? Or are we writing a new compiler in C?
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
saiyadshakil
Newbie


Posts: 4
|
 |
Re: :o Google Question
« Reply #2 on: Oct 4th, 2007, 9:38am » |
Quote Modify
|
yeah it is already implemented in C but they want to see how you can implement your own MALLOC function....I mean to say .."allocate memory dynamically w/t using malloc in C"...so he gave the hint to write definition of malloc in C...
|
|
IP Logged |
|
|
|
GowriKumar
Junior Member
 


Gender: 
Posts: 55
|
 |
Re: :o Google Question
« Reply #3 on: Oct 24th, 2007, 11:10am » |
Quote Modify
|
The C Bible, K & R C has an impelemntation for malloc Hint : use brk() system call.
|
|
IP Logged |
www.gowrikumar.com
|
|
|
saiyadshakil
Newbie


Posts: 4
|
 |
Re: :o Google Question
« Reply #4 on: Oct 24th, 2007, 12:53pm » |
Quote Modify
|
ohhh thanks...
|
|
IP Logged |
|
|
|
|