Pawn Memory
I'm working with large strings. I read information from a file, and place it into a 2D array. (About 15 total strings). I know nothing about memory, (besides how statics work and such). My question is, below is two functions. I'm using the first one. When the function is done, is all that memory free'd up? If not, wouldn't it be better to use the second one?
Code:
|
Re: Pawn Memory
The problem is that Array is slower than the first one, and will lag your server.
I suggest using the first one. After Function() execution the memory will be freed after end of execution After Function(2) execution, alloc, insert, get and after that the memory will be freed. And as memory loss. It is basically the same. 4*15*1024 = 61440B = 60KB |
Re: Pawn Memory
Quote:
If you know the precise size of your array, you should use the first implementation. How often is your function called? |
Re: Pawn Memory
Quote:
(from g_FinalString) |
Re: Pawn Memory
The look-up operation is faster using the raw way, if that's not a problem. Don't worry about memory management, as long as you call a destroy function for every create function you call, it's fine.
|
| All times are GMT -4. The time now is 22:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.