SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Plugin Development (https://forum.sa-mp.com/forumdisplay.php?f=18)
-   -   [Plugin] PAWN memory access plugin (https://forum.sa-mp.com/showthread.php?t=645166)

BigETI 21/11/2017 12:38 PM

PAWN memory access plugin
 
PAWN memory access plugin
A successor to http://forum.sa-mp.com/showthread.php?t=451381


Description
The PAWN memory access plugin allows to allocate and free memory from heap in PAWN.


Project
All of the source code, builds and documentations are located at GitHub: https://github.com/BigETI/pawn-memory

StrikerZ 21/11/2017 01:52 PM

Re: PAWN memory access plugin
 
Good job! It'll be useful

IlanZ 21/11/2017 04:19 PM

Re: PAWN memory access plugin
 
Nice job.

TommyB 21/11/2017 04:26 PM

Re: PAWN memory access plugin
 
10/10 best plugin ever used.

DimaShift 21/11/2017 05:02 PM

Re: PAWN memory access plugin
 
nice plugin! ++

Kaperstone 21/11/2017 06:26 PM

Re: PAWN memory access plugin
 
I have weak knowledge in c, can it be explained what is the difference between managed and unmanaged if (anyway) I need to delete both of them to prevent memory leak?

BigETI 22/11/2017 04:53 AM

Re: PAWN memory access plugin
 
The concept of managed and unmanaged memory is not from C. Allocating managed memory in this context stores extra information such as the validity of a pointer and the size of the allocated block of memory. These information are used on calls to validate input, also on plugin unload all "managed" blocks of memory are freed back to the underlying system. Allocating unmanaged memory in this context doesn't really hold the information of the validity of a pointer, neither the size of the allocated block of memory. This concludes that the operations are faster, but they're prone to get misused by programmers, which then can mess up the working virtual memory space by using invalid pointers or overwriting blocks of memory that were not allocated, or used by different program code. Also "unmanaged" memory is not explicitly freed at plugin unload. The counterpart of MEM_new* and MEM_clone is MEM_delete, where the counterpart of MEM_UM_new* and MEM_UM_clone is MEM_UM_delete.

Whitetiger 23/11/2017 04:49 AM

Re: PAWN memory access plugin
 
What's the advantage of this over your old plugin? Why would I wanna allocate memory on the PAWN heap when I can do the same thing without messing with PAWN's heap in your other plugin?

BigETI 23/11/2017 11:44 AM

Re: PAWN memory access plugin
 
Memory is not allocated on PAWN heap memory. It is allocated on the application's heap memory.

DavidZvla 27/02/2018 01:29 AM

Re: PAWN memory access plugin
 
How i get the .dll or .so file? or how can i setup this plugin?

Code:

[debug] Run time error 19: "File or function is not found"
[debug]  MEM_get_val
[debug]  MEM_get_size
[debug]  MEM_get_arr
[debug]  MEM_delete
[debug]  MEM_new_arr
[debug]  MEM_set_val
[debug] Run time error 19: "File or function is not found"
[debug]  MEM_get_val
[debug]  MEM_get_size
[debug]  MEM_get_arr
[debug]  MEM_delete
[debug]  MEM_new_arr
[debug]  MEM_set_val



All times are GMT. The time now is 02:52 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.