Git Product home page Git Product logo

Comments (5)

hariguchi avatar hariguchi commented on September 14, 2024

Dear Barak,

Thank you for your comment. You are right. I forgot to add the table deletion API function. Here is my answers:

  1. It seems OK although I cannot find the definitions of the followings:
    • deletep(): Maybe the same as bool (*delete)(rtTable* p, u8* pDest, int plen) in the original?
    • vector rEnts: Maybe std::vector<routeEnt*> rEnts?
  2. Yes, I will add two API functions. One is rtArtFlushRoutes(rtTable *pt). This function will delete all the routes in *pt. The other is rtArtDeleteTable(rtTable *pt). This function will call rtArtFlushRoutes(), then deallocate all memories inside *pt, then free `pt' itself (just like your code does in the last part of the wrapper.) It will be written in C.

Cordially yours,
Yoichi

from art.

bakinat avatar bakinat commented on September 14, 2024
  1. yes - we renamed delete with deletep for C++ compatibility. yes -
    vector is std::vector - we had to use a vector since its not possible to
    delete the entries while performing a walk.
  2. This will be great. You will probably not need a vector as the Flush
    will take care of it.
    Thank you!

------ Original Message ------
From: "Yoichi Hariguchi" [email protected]
To: "hariguchi/art" [email protected]
Cc: "bakinat" [email protected]; "Author"
[email protected]
Sent: 17/08/2016 22:50:09
Subject: Re: [hariguchi/art] There is no API to delete the routing table
and free its memory (#2)

Dear Barak,

Thank you for your comment. You are right. I forgot to add the table
deletion API function. Here is my answers:

It seems OK although I cannot find the definitions of the followings:
deletep(): Maybe the same as "bool (delete)(rtTable p, u8* pDest, int
plen)" in the original?vector rEnts: Maybe "std::vector rEnts"?Yes, I
will add two API functions. One is "rtArtFlushRoutes(rtTable pt)." This
function will delete all the routes in pt.' The other is "rtArtDeleteTable(rtTable pt)." This function will call rtArtFlushRoutes()', then deallocate all memories insidept', then free pt' itsel (just like your code does in the last part of the wrapper.)
It will be written in C.
Cordially yours,
Yoichi


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from art.

hariguchi avatar hariguchi commented on September 14, 2024

Hi Barak,

I implemented:

  1. Flush Routes: which deletes all the route entries
  2. Delete Routing Table: which deletes all the rout entries, then delete the table itself and free its memory.

Please check README and the source code.

from art.

bakinat avatar bakinat commented on September 14, 2024

Thank you very much!
So far from my testing it looks good!

from art.

hariguchi avatar hariguchi commented on September 14, 2024

My pleasure. Unfortunately, this version iterates the trie twice (like your implementation.) The first iteration collects all the routes; the second iteration deletes them. I tried to make a single iteration version, but it is challenging due to lack of back pointers between nodes. I think it is OK since flushing will not happen that often.

from art.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.