[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10757 - gnuradio/branches/developers/jcorgan/gpio2/gr
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r10757 - gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src |
Date: |
Fri, 3 Apr 2009 07:04:05 -0600 (MDT) |
Author: jcorgan
Date: 2009-04-03 07:04:04 -0600 (Fri, 03 Apr 2009)
New Revision: 10757
Modified:
gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src/usrp2.i
Log:
Use new and delete instead of malloc
Modified: gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src/usrp2.i
===================================================================
--- gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src/usrp2.i
2009-04-03 07:16:00 UTC (rev 10756)
+++ gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src/usrp2.i
2009-04-03 13:04:04 UTC (rev 10757)
@@ -199,15 +199,15 @@
// some utility functions to allow Python to deal with pointers
%{
- long *make_long_ptr() { return (long *)malloc(sizeof(long)); }
+ long *make_long_ptr() { return new long; }
long deref_long_ptr(long *l) { return *l; }
- void free_long_ptr(long *l) { free(l); }
- int *make_int_ptr() { return (int *)malloc(sizeof(int)); }
+ void free_long_ptr(long *l) { delete l; }
+ int *make_int_ptr() { return new int; }
int deref_int_ptr(int *l) { return *l; }
- void free_int_ptr(int *l) { free(l); }
- uint16_t *make_uint16_ptr() { return (uint16_t *)malloc(sizeof(uint16_t)); }
+ void free_int_ptr(int *l) { delete l; }
+ uint16_t *make_uint16_ptr() { return new uint16_t; }
int deref_uint16_ptr(uint16_t *l) { return *l; }
- void free_uint16_ptr(uint16_t *l) { free(l); }
+ void free_uint16_ptr(uint16_t *l) { delete l; }
%}
long *make_long_ptr();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10757 - gnuradio/branches/developers/jcorgan/gpio2/gr-usrp2/src,
jcorgan <=